package com.fzy.springsecurity2.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fzy.springsecurity2.utils.MyJacksonTypeHandler;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author fzy
 * @since 2024-10-13
 */
@Data
@TableName(value = "t_stu", autoResultMap = true)
public class TStu extends Model<TStu> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("name")
    private String name;

    @TableField("age")
    private Integer age;

    @TableField("height")
    private Double height;

    @TableField("birth")
    private LocalDate birth;

    @TableField("sex")
    private String sex;

    @TableField(value = "hobbies", typeHandler = MyJacksonTypeHandler.class)
    private List<String> hobbies;

    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
